var express = require('express');
var router = express.Router();
var sql = require('./../sql');
var Banner = require('./../sql/col/banners')
/**
 * @api {get} api/banner 获取轮播图数据
 * @apiDescription 获取轮播图数据
 * @apiGroup banner
 * @apiSuccessExample { json }                         Success-Response:
 * {
 *  code :'200',
 *  message: '获取轮播图数据',
 *  data: []
 * }
 * @apiSampleRequest /api/banner
 * @apiVersion 1.0.0
 */
/* GET home page. */
router.get('/', function(req, res, next) {
  // res.send('轮播图相关接口');
  sql.find(Banner,{},{_id:0}).then(data=>{
    res.send({
      code:'200',
      message:'获取轮播图数据',
      data:data
    });
  })
});

module.exports = router;

